package com.yyj.service;

import com.yyj.dao.TPropertyConfigMapper;
import com.yyj.model.TPropertyConfig;
import com.yyj.model.TPropertyConfigExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConfigService {

    @Autowired
    TPropertyConfigMapper configMapper;

    public TPropertyConfig getConfigInfo(String configCode){
        TPropertyConfig PropertyConfig = null;
        TPropertyConfigExample configExample = new TPropertyConfigExample();
        TPropertyConfigExample.Criteria criteria = configExample.createCriteria();
        criteria.andConfigCodeEqualTo(configCode);
        List<TPropertyConfig> list = configMapper.selectByExample(configExample);
        if(list.size() > 0){
            PropertyConfig = list.get(0);
        }
        return PropertyConfig;
    }
}
